<extend name="Layout:layout_form" />
<block name="body_main">
    <taglib name="Common\TagLib\Sohtml"/>
    <form action="{:AddonU('category_edit_save')}" method="post" class="xsui-form">        
        <fieldset>
            <div class="xsui-form-field">
                <label>名称：</label>            
                <input type="text" name="title" placeholder="名称" required="required" value="{$data.title}"/>
            </div>
            <div class="xsui-form-field">
                <label>上级：</label>            
                <select name="pid" data-url="{:AddonU('get_category_tree_json')}"></select>
            </div>
            <div class="xsui-form-field">
                <label>备注：</label>            
                <input type="text" name="remark" placeholder="备注" value="{$data.remark}"/>
            </div>
            <div class="xsui-form-field">
                <label>状态：</label>
                <sohtml:radio name="status" items="1=正常;0=禁用" value="{$data.status|default=0}" />
            </div>
        </fieldset>
        <input type="hidden" name="id" value="{$data.id}" />
        <button type="submit" class="xsui-hidden">提交</button>
    </form>  
</block>
<block name="body_foot_script">
    <script>
        $(function () {
            FormPage.ui_init();
            ajax_combobox({selector: 'select[name="pid"]', def_option: '请选择'});
        })
    </script>
</block>